package org.penguin.boot.security.validation.annotation;

import org.penguin.boot.security.validation.annotation.util.PasswordConstraintValidator;


import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author : cyhch
 * @version : 1.0
 * @createdTime : 2023/12/19 20:10
 * @since : 1.0
 */


@Documented
@Constraint(validatedBy = PasswordConstraintValidator.class)
@Target({FIELD, ANNOTATION_TYPE})
@Retention(RUNTIME)
public @interface ValidPassword {

    String message() default "无效的密码！";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
